﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Login.aspx.cs" Inherits="Login" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

    
</script>
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>登录</title>
    <style type="text/css">
        .style1
        {
            width: 100%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div style="text-align: center">
    
        <table class="style1">
            <tr>
                <td>
                    <asp:Label ID="Label1" runat="server" Text="留言板登录" 
                        style="font-family: 隶书; font-size: xx-large"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label2" runat="server" Text="用户：" 
                        style="font-size: large; font-family: 隶书"></asp:Label>
                    &nbsp;&nbsp;<asp:TextBox ID="TextBoxName" runat="server" Height="30px" Width="150px" 
                        style="font-size: large; font-family: 隶书"></asp:TextBox>
                    <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                        ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        DeleteCommand="DELETE FROM [user_profile] WHERE [id] = @id" 
                        InsertCommand="INSERT INTO [user_profile] ([username], [password]) VALUES (@username, @password)" 
                        SelectCommand="SELECT * FROM [user_profile]" 
                        UpdateCommand="UPDATE [user_profile] SET [username] = @username, [password] = @password WHERE [id] = @id">
                        <DeleteParameters>
                            <asp:Parameter Name="id" Type="Int32" />
                        </DeleteParameters>
                        <InsertParameters>
                            <asp:Parameter Name="username" Type="String" />
                            <asp:Parameter Name="password" Type="String" />
                        </InsertParameters>
                        <UpdateParameters>
                            <asp:Parameter Name="username" Type="String" />
                            <asp:Parameter Name="password" Type="String" />
                            <asp:Parameter Name="id" Type="Int32" />
                        </UpdateParameters>
                    </asp:SqlDataSource>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:Label ID="Label3" runat="server" Text="密码：" 
                        style="font-size: large; font-family: 隶书"></asp:Label>
                    &nbsp;
                    <asp:TextBox ID="TextBoxPassword" runat="server" Height="30px" Width="150px" 
                        style="font-size: large; font-family: 隶书" TextMode="Password"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td>
                    <asp:Button ID="ButtonLogin" runat="server" Text="登录" onclick="Button1_Click" 
                        style="font-size: x-large; font-family: 隶书" />
                &nbsp;&nbsp;&nbsp;
                    <asp:Button ID="ButtonReturn" runat="server" Text="返回" 
                        onclick="ButtonReturn_Click" style="font-size: x-large; font-family: 隶书" />
                    <br />
                    <br />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    
    </div>
    </form>
</body>
</html>
